﻿<UserControl x:Class="UI.Module.Admin.UsersView"  
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:prism="http://www.codeplex.com/prism"
             xmlns:V="clr-namespace:UI.Core.View;assembly=UI.Core"
             xmlns:V2="clr-namespace:UI.Core.Interaction;assembly=UI.Core"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:Behaviors="clr-namespace:UI.Core.Behaviors;assembly=UI.Core"
             xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
             xmlns:local="clr-namespace:UI.Module.Admin" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <i:Interaction.Triggers>
        <prism:InteractionRequestTrigger SourceObject="{Binding SelectedUserRequest, Mode=OneWay}">
            <V2:PopupWindowAction IsModal="True" CenterOverAssociatedObject="True">
                <V2:PopupWindowAction.WindowContent>
                    <local:UserView/>
                </V2:PopupWindowAction.WindowContent>
            </V2:PopupWindowAction>
        </prism:InteractionRequestTrigger>
    </i:Interaction.Triggers>

        <Grid>
        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        </Grid.Resources>
        <xcdg:DataGridControl ItemsSource="{Binding Path=Users, Mode=OneWay}" SelectedItem="{Binding Path=SelectedUser, Mode=TwoWay}" HorizontalAlignment="Stretch">
        </xcdg:DataGridControl>
        <!--<ig:XamGrid Margin="5" Visibility="{Binding IsLoaded, Mode=TwoWay, Converter={StaticResource BooleanToVisibilityConverter}}" 
                    ItemsSource="{Binding Users, Mode=OneWay}" 
                    ActiveItem="{Binding SelectedUser, Mode=TwoWay}"
                    
                    HorizontalAlignment="Stretch" AutoGenerateColumns="False">
            <i:Interaction.Behaviors>
                <Behaviors:XamGridDoubleClickBehavior DoubleClick="{Binding EditCommand}" DisableDetach="false"/>
            </i:Interaction.Behaviors>
            <ig:XamGrid.EditingSettings>
                <ig:EditingSettings AllowEditing="None"/>
            </ig:XamGrid.EditingSettings>
            <ig:XamGrid.RowSelectorSettings>
                <ig:RowSelectorSettings Visibility="Visible" EnableRowNumbering="True"/>
            </ig:XamGrid.RowSelectorSettings>
            <ig:XamGrid.FilteringSettings>
                <ig:FilteringSettings AllowFiltering="FilterRowTop" FilteringScope="ColumnLayout" />
            </ig:XamGrid.FilteringSettings>
            <ig:XamGrid.SelectionSettings>
                <ig:SelectionSettings RowSelection="Single" CellClickAction="SelectRow" CellSelection="None" ColumnSelection="None"  />
            </ig:XamGrid.SelectionSettings>
            <ig:XamGrid.Columns>
                <ig:TextColumn Key="UserId" HeaderText="Id" AllowToolTips="Always"/>
                <ig:TextColumn Key="FirstName" HeaderText="First" AllowToolTips="Always"/>
                <ig:TextColumn Key="LastName" HeaderText="Last" AllowToolTips="Always"/>
                <ig:TextColumn Key="Email" HeaderText="Email" AllowToolTips="Always"/>
                <ig:TextColumn Key="Adress" HeaderText="Adress" AllowToolTips="Always"/>
                <ig:TextColumn Key="ProfilId" HeaderText="Profil" AllowToolTips="Always"/>
            </ig:XamGrid.Columns>
        </ig:XamGrid>-->

        <V:Spinner Visibility="{Binding IsBusy, Mode=TwoWay, Converter={StaticResource BooleanToVisibilityConverter}}"/>

    </Grid>
</UserControl>
